package com.jerry.alibaba.transaction.controller;

import com.jerry.alibaba.transaction.entity.CommonResult;
import com.jerry.alibaba.transaction.entity.Order;
import com.jerry.alibaba.transaction.service.OrderFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class OrderController {

    @Resource
    private OrderFeignService orderFeignService;

    @GetMapping("/client/order/create")
    public CommonResult create(Order order) {
        return orderFeignService.create(order);
    }

    @GetMapping("/client/order/get")
    public CommonResult getList() {
        return orderFeignService.getList();
    }

    @GetMapping("/client/order/get/{id}")
    public CommonResult getById(@PathVariable("id") Long id) {
        return orderFeignService.getById(id);
    }

}
